Package edu.uky.ai.lp
Class Result
java.lang.Object
edu.uky.ai.lp.Result
public class Result
extends java.lang.Object
Describes the result of a single action taken by the player, including any
new information gained.
- Author:
- Stephen G. Ware
-
Field Summary
Fields Modifier and Type Field Description booleanbreezeIndicates if the square the player just moved to has a breezestatic ResultEATA special result indicating that the player was eaten by the wumpusstatic ResultFALLA special result indicating that the player fell into a pitbooleanglitterIndicates if the square the player just moved to glittersstatic ResultGRABA special result indicating that the player picked up the goldstatic ResultNOTHINGA special result indicating that the player's action has no effect on the game statebooleanstenchIndicates if the square the player just moved to has a stenchstatic ResultWINA special result indicating that the player won -
Constructor Summary
-
Method Summary
Modifier and Type Method Description java.lang.StringtoString()
-
Field Details
-
stench
public final boolean stenchIndicates if the square the player just moved to has a stench -
breeze
public final boolean breezeIndicates if the square the player just moved to has a breeze -
glitter
public final boolean glitterIndicates if the square the player just moved to glitters -
NOTHING
A special result indicating that the player's action has no effect on the game state -
GRAB
A special result indicating that the player picked up the gold -
WIN
A special result indicating that the player won -
EAT
A special result indicating that the player was eaten by the wumpus -
FALL
A special result indicating that the player fell into a pit
-
-
Constructor Details
-
Result
public Result(boolean stench, boolean breeze, boolean glitter)Creates a result which indicates sensory information about the square the player just moved to.- Parameters:
stench- indicates if the square the player just moved to has a stenchbreeze- indicates if the square the player just moved to has a breezeglitter- indicates if the square the player just moved to glitters
-
Result
public Result(java.lang.String message)Creates a result which displayed a special message.- Parameters:
message- the message to display
-
-
Method Details
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-